package com.suyi.service.impl;

import com.suyi.dao.TStorageDao;
import com.suyi.service.TStorageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 贺袁晨
 * @since 2021-04-28
 */
@Service
public class TStorageServiceImpl implements TStorageService {

    private static final Logger LOGGER = LoggerFactory.getLogger(TStorageServiceImpl.class);

    @Autowired
    private TStorageDao storageDao;
    /**
     * 扣减库存
     */
    @Override
    public void decrease(@RequestParam("productId") Long productId, @RequestParam("count") Integer count) {
        LOGGER.info("------->storage-service中扣减库存开始");
        storageDao.decrease(productId,count);
        LOGGER.info("------->storage-service中扣减库存结束");
    }
}
